package com.jinzhi.common.filter;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.jinzhi.common.config.InvoiceConfig;
import com.jinzhi.common.service.DictService;
import com.jinzhi.common.utils.ApiResult;
import com.jinzhi.common.utils.yongyou.ParameterUtil;
import com.jinzhi.jzweb.domain.InvoiceDO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.chain.Command;
import org.apache.commons.chain.Context;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.*;

/**
 * @program: InvoiceUractiveFilter
 * @description:
 * @author: Kl
 * @create: 2019-12-6 16:39
 **/
@Slf4j
@Component
public class InvoiceUractiveFilter implements Command {

    @Autowired
    private DictService dictService;

    @Override
    public boolean execute(Context context) throws Exception {
        String buildFpqqlsh = UUID.randomUUID().toString().replace("-", "").substring(0, 20);
        //获取返回对象
        ApiResult apiResult = (ApiResult) context.get(InvoiceConfig.API_RESULT);
        //获取返回订单信息
        Long id = (Long) context.get("OrderDO");
//        OrderDO order = orderService.selectById(id);
        EntityWrapper<InvoiceDO> wrapper = new EntityWrapper<>();
//        wrapper.eq("uid", order.getUid());
        wrapper.eq("defaultIs", true);
        //todo 这里需要获取发票信息实体
        try {
        } catch (Exception e) {
            apiResult.setCode(InvoiceConfig.ERROR_CODE);
            apiResult.setMsg("组装Map失败");
            return true;
        }
        return false;
    }

}
